package com.hxk;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
 * info日志消息
 * @author Cactus
 */
@Component
@RabbitListener(
			bindings=@QueueBinding(
					//配置交换器
					exchange=@Exchange(value="${mq.config.exchange}",type=ExchangeTypes.TOPIC),
					//配置路由键
					key="*.log.info",
					//配置队列名称
					value=@Queue(value="${mq.config.queue.info}",autoDelete="true")
			)
		)
public class InfoConsumer {
	/**
	 * 接收消息
	 * @param msg
	 */
	@RabbitHandler
	public void process(String msg) {
		System.out.println(".....Info.....Receiver:"+msg);
	}
}
